package sys

import (
	v1 "ginweb-admin/api/v1"
	"github.com/gin-gonic/gin"
)

type SysUserRouter struct{}

func (router *SysUserRouter) InitSysUserRouter(Router *gin.RouterGroup) {
	// 获取登录的api接口
	sysUserApi := v1.WebApiGroupApp.SysUser.SysUserApi
	// 创建路由组
	sysUserApiGroup := Router.Group("/sys/user")
	{
		// 保存用户
		sysUserApiGroup.POST("/save", sysUserApi.SaveData)
		// 用户修改密码
		sysUserApiGroup.POST("/update/self/pwd", sysUserApi.UpdatePwdSelf)
		// 管理员修改用户密码
		sysUserApiGroup.POST("/update/pwd", sysUserApi.UpdatePwd)
		// 修改用户信息
		sysUserApiGroup.POST("/update", sysUserApi.UpdateData)
		// 修改用户状态
		sysUserApiGroup.POST("/update/status", sysUserApi.UpdateStatus)
		// 删除单个用户
		sysUserApiGroup.POST("/deleteById/:id", sysUserApi.DeleteById)
		// 批量删除用户
		sysUserApiGroup.POST("/deleteByIds", sysUserApi.DeleteIds)
		// 根据用户ID查询
		sysUserApiGroup.POST("/getById/:id", sysUserApi.GetById)
		// 分页查询
		sysUserApiGroup.POST("/load/page", sysUserApi.LoadPage)

	}
}
